<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewOrgaoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">

            <!--<h:form prependId="false">-->
            <p:growl id="messages" life="3000"/>

            <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
            </h:panelGroup>

            <p:panel >

                <f:facet name="header">

                    <h:outputText value="#{bundle.LegendOrgaoTitle}"/>
                </f:facet>                
                <h:panelGrid columns="2">
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgId}"/>
                    <h:outputText value="#{orgaoController.selected.orgId}" title="#{bundle.ViewOrgaoTitle_orgId}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgCnpj}"/>
                    <h:outputText value="#{orgaoController.selected.maskCnpj}" converter="inputConverter" title="#{bundle.ViewOrgaoTitle_orgCnpj}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgSg}"/>
                    <h:outputText value="#{orgaoController.selected.orgSg}" title="#{bundle.ViewOrgaoTitle_orgSg}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgNm}"/>
                    <h:outputText value="#{orgaoController.selected.orgNm}" title="#{bundle.ViewOrgaoTitle_orgNm}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgTxConsorcio}"/>
                    <h:outputText value="#{orgaoController.selected.orgTxConsorcio}" title="#{bundle.ViewOrgaoTitle_orgTxConsorcio}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgTxEndereco}"/>
                    <h:outputText value="#{orgaoController.selected.orgTxEndereco}" title="#{bundle.ViewOrgaoTitle_orgTxEndereco}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgUfdCd}"/>
                    <h:outputText value="#{orgaoController.selected.orgUfdCd.ufdSg}" title="#{bundle.ViewOrgaoTitle_orgUfdCd}"/>                        
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgMunCd}"/>
                    <h:outputText value="#{orgaoController.selected.orgMunCd.munNm}" title="#{bundle.ViewOrgaoTitle_orgMunCd}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgTxCep}"/>
                    <h:outputText value="#{orgaoController.selected.orgTxCep}" converter="inputConverter" title="#{bundle.ViewOrgaoTitle_orgTxCep}"/>                        
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgNmRepresentante}"/>
                    <h:outputText value="#{orgaoController.selected.orgNmRepresentante}" title="#{bundle.ViewOrgaoTitle_orgNmRepresentante}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgCargo}"/>
                    <h:outputText value="#{orgaoController.selected.orgCargo}" title="#{bundle.ViewOrgaoTitle_orgCargo}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgTxTelefone}"/>
                    <h:outputText value="#{orgaoController.selected.orgTxTelefone}" converter="inputConverter" title="#{bundle.ViewOrgaoTitle_orgTxTelefone}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgTxTelefone2}"/>
                    <h:outputText value="#{orgaoController.selected.orgTxTelefone2}" converter="inputConverter" title="#{bundle.ViewOrgaoTitle_orgTxTelefone2}"/>
                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgEmail}"/>
                    <h:outputText value="#{orgaoController.selected.orgEmail}" title="#{bundle.ViewOrgaoTitle_orgEmail}"/>

                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgStatus}"/>
                    <h:outputText value="#{orgaoController.selected.orgStgId.stgNm}" title="#{bundle.ViewOrgaoTitle_orgStatus}" />

                    <h:outputText value="#{bundle.ViewOrgaoLabel_orgTxObservacao}"/>
                    <h:outputText value="#{orgaoController.selected.orgTxObservacao}" title="#{bundle.ViewOrgaoTitle_orgTxObservacao}"/>

                    <h:outputLabel value="#{bundle.createBy}" for="nomeCriador" rendered="#{not empty orgaoController.criacaoHist.nomeUsuario}"/>
                    <h:outputText id="nomeCriador" value="#{orgaoController.criacaoHist.nomeUsuario}" rendered="#{not empty orgaoController.criacaoHist.nomeUsuario}"/>
                    <h:outputLabel value="#{bundle.createDate}" for="dataCriacao" rendered="#{not empty orgaoController.criacaoHist.dataHora}"/>
                    <h:outputText id="dataCriacao" value="#{orgaoController.criacaoHist.dataHora}" rendered="#{not empty orgaoController.criacaoHist.dataHora}"/>     
                    <h:outputLabel value="#{bundle.updateBy}" for="nomeAlterador" rendered="#{not empty orgaoController.alteracaoHist.nomeUsuario}"/>
                    <h:outputText id="nomeAlterador" value="#{orgaoController.alteracaoHist.nomeUsuario}" rendered="#{not empty orgaoController.alteracaoHist.nomeUsuario}"/>
                    <h:outputLabel value="#{bundle.updateDate}" for="dataAlteracao" rendered="#{not empty orgaoController.alteracaoHist.dataHora}"/>
                    <h:outputText id="dataAlteracao" value="#{orgaoController.alteracaoHist.dataHora}" rendered="#{not empty orgaoController.alteracaoHist.dataHora}" /> 
                </h:panelGrid>

                <br />
                <p:commandButton id="deleteCommand" rendered="#{autenticadorController.loginAdmin}" onclick="confirmationDestroy.show()" value="#{bundle.ViewOrgaoDestroyLink}" type="button" icon="ui-icon-trash" />&nbsp;                    
                <p:commandButton ajax="false" rendered="#{!autenticadorController.loginVisualizador}" action="Edit" value="#{bundle.ViewOrgaoEditLink}"/> &nbsp;
                <p:commandButton ajax="false" action="#{orgaoController.prepareList}" value="#{bundle.ViewOrgaoShowAllLink}" immediate="true"/>
                <p:commandButton ajax="false" action="#{orgaoController.prepareListaInativos}" value="#{bundle.EditOrgaoInativosShowAllLink}" immediate="true"/>
            </p:panel>
            <p:confirmDialog id="confirmDestroy" message="#{bundle.MsgConfirmDestroy_message}" header="#{bundle.MsgConfirmDestroy_header}" severity="alert" widgetVar="confirmationDestroy">
                <p:commandButton id="confirm" ajax="false" value="#{bundle.MsgDialog_confirmar}"  oncomplete="confirmationDestroy.hide();" action="#{orgaoController.destroy}" />
                <p:commandButton id="decline" value="#{bundle.MsgDialog_cancelar}" update="messages" onclick="confirmationDestroy.hide()" type="button"/>
            </p:confirmDialog>
            <!--</h:form>-->
        </ui:define>
    </ui:composition>

</html>

